﻿using CSharpPro2._1030;

namespace CSharpPro._1030;

public class Demo
{
    public int id;
    private string name;
    private int age;

    public void TestPrint()
    {
        Child child = new Child();
        child.Print();
        Console.WriteLine("---------------------");
        Father f1 = new Child();
        f1.Print();
        Father father = new Father();
        father.Print();
        Son son = new Son();
        son.Print();
    }
    public Demo(int id, string name, int age)
    {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public string Name
    {
        get => name;
        set => name = value;
    }

    public int Age
    {
        get => age;
        set => age = value;
    }

    public int Id
    {
        //get => id;
        get { return id; }
        set => id = value;
    }

    public void Test()
    {
        int result = Add(10,20);
        Add(2.0, 3.0);
    }

    public int Add(int a, int b)
    {
        return a + b;
    }
    public double Add(double a, int b)
    {
        return a + b;
    }
    public double Add(int a, double b)
    {
        return a + b;
    }
    public static double Add(double a, double b)
    {
        return a + b;
    }
}